package com.xinongbest.cloud.mall.practice.common.exception;

/**
 * @author lemonwan
 * 异常枚举类
 */
public enum ImoocMallExceptionEnum {
    NEED_USER_NAME(10001, "用户名不能为空"),
    NEED_PASSWORD(10002, "密码不能为空"),
    PASSWORD_TOO_SHORT(10003, "密码不能少于8位"),
    NAME_EXISTED(10004, "名称已存在"),
    INSERT_FAILED(10005, "注册失败，请重试"),
    WRONG_PASSWORD(10006, "密码错误"),
    NEED_LOGIN(10007, "用户未登录"),
    UPDATE_FAILED(10008, "更新失败"),
    NEED_ADMIN(10009, "需要管理员权限"),
    PARAM_NOT_NULL(10010, "参数不能为空"),
    CREATE_FAILED(10011, "创建失败"),
    REQUEST_PARAM_ERROR(10012, "参数错误"),
    DELETE_FAILED(10013, "删除失败"),
    MAKE_DIR_FIELD(10014, "目录创建失败"),
    UPLOAD_FILE_FIELD(10015, "上传失败"),
    NOT_SALE(10016, "商品不可售"),
    NOT_ENOUGH(10017, "商品库存不足"),
    CART_EMPTY(10018, "购物车无选中商品"),
    NO_ENUM(10019, "不存在的类型"),
    SYSTEM_ERROR(20000, "系统错误");

    Integer code;

    String msg;

    ImoocMallExceptionEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
